package cn.liutao.dish.entity.po;

import cn.liutao.common.entity.BaseEntity;
import cn.liutao.common.entity.Validation;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 菜品表 实体类。
 *
 * @author liutao
 * @since 2023-11-01
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "dish")
public class Dish extends BaseEntity implements Serializable {

    @Id(keyType = KeyType.Auto)
    @NotNull(message = "请选择要修改的菜品",groups = Validation.EditGroup.class)
    private Integer id;

    @NotNull(message = "请选择所属菜系",groups = Validation.AddGroup.class)
    private Integer cuisineId;

    /**
     * 菜品名称
     */
    @NotBlank(message = "菜品名称不能为空",groups = Validation.AddGroup.class)
    private String name;

    /**
     * 菜品价格
     */
    @NotNull(message = "价格不能为null",groups = Validation.AddGroup.class)
    private BigDecimal price;

    /**
     * 图片
     */
    private String img;

    /** 类型0新品推荐，1热销霸榜，3用户好评*/
    private Integer type;

    /**
     * 启用状态：0禁用，1启用
     */
    private Integer status;


    /**
     * 排序字段(值越小，越靠前)
     */
    private Integer sort;

    /**
     * 描述
     */
    private String describe;

}
